package cn.fresh.xuanyuan.module.member.dal.mysql.user;

import cn.fresh.xuanyuan.framework.common.pojo.PageParam;
import cn.fresh.xuanyuan.framework.common.pojo.PageResult;
import cn.fresh.xuanyuan.framework.mybatis.core.mapper.BaseMapperX;
import cn.fresh.xuanyuan.module.member.dal.dataobject.user.MemberCollectDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface MemberCollectMapper extends BaseMapperX<MemberCollectDO> {

    default PageResult<MemberCollectDO> selectPage(Long userId, PageParam pageParam) {
        LambdaQueryWrapper<MemberCollectDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MemberCollectDO::getUserId, userId).eq(MemberCollectDO::getDeleted, false);
        return selectPage(pageParam, queryWrapper);
    }
}
